package com.quanshu.shop.person.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.quanshu.exchange.R;
import com.quanshu.exchange.support.config.Config;
import com.quanshu.shop.person.entity.MylikeEntity;

import java.util.List;

/**
 * 作者  李哲
 * 创建时间 2018/7/20
 * 邮箱 lizhetongliao@163.com
 * 说明
 **/
public class LikeGoodsAdapter extends BaseQuickAdapter<MylikeEntity.DataEntity, BaseViewHolder> {
    private Context mContext;

    public LikeGoodsAdapter(@Nullable List<MylikeEntity.DataEntity> data, Context context1) {
        super(R.layout.item_my_like, data);
        mContext = context1;
    }

    @Override
    protected void convert(BaseViewHolder helper, MylikeEntity.DataEntity item) {
        Glide.with(mContext).load(Config.URL_HOST_SHOP + item.img).into((ImageView) helper.getView(R.id.like_img));
        helper.setText(R.id.like_goods_name, item.name);
        helper.setText(R.id.like_goods_money, "¥ " + item.sell_price);
        helper.addOnClickListener(R.id.like_goods);
    }
}
